#include <stdio.h>
//#include <sys/types.h>
#include<pthread.h>
#include <stdlib.h>
void* printf_hello(void *arg)
{
    while (1)
    {
        printf("hello\n");
        sleep(1);
    }
    
}
void* printf_world(void *arg)
{
    while (1)
    {
        printf("world\n");
        sleep(1);
    }
    
}

int main(int argc,char **argv)
{
    pthread_t p1;
    pthread_t p2;
    int ret=pthread_create(&p1,NULL,printf_hello,NULL);
    if(ret<0)
    {
        perror("pthread_create error\n");
        exit(1);
    }
    ret=pthread_create(&p2,NULL,printf_world,NULL);
    if(ret<0)
    {
        perror("pthread_create error\n");
        exit(1);
    }
    pthread_join(p1,NULL);
    pthread_join(p2,NULL);


    return 0;
}